import request from '@/utils/request'

// 查询工程项目信息列表
export function listProject(query) {
  return request({
    url: '/projectManager/project/list',
    method: 'get',
    params: query
  })
}

// 查询工程项目信息详细
export function getProject(id) {
  return request({
    url: '/projectManager/project/' + id,
    method: 'get'
  })
}

// 新增工程项目信息
export function addProject(data) {
  return request({
    url: '/projectManager/project',
    method: 'post',
    data: data
  })
}

// 修改工程项目信息
export function updateProject(data) {
  return request({
    url: '/projectManager/project',
    method: 'put',
    data: data
  })
}

// 删除工程项目信息
export function delProject(id) {
  return request({
    url: '/projectManager/project/' + id,
    method: 'delete'
  })
}

// 导出工程项目信息
export function exportProject(query) {
  return request({
    url: '/projectManager/project/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 审核工程项目信息
export function reviewProject(data) {
  return request({
    url: '/projectManager/project/review',
    method: 'put',
    data: data
  })
}

// 导入工程项目信息
export function importProject(data) {
  return request({
    url: '/projectManager/project/importData',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 下载导入模板
export function importTemplate() {
  return request({
    url: '/projectManager/project/importTemplate',
    method: 'get',
    responseType: 'blob'
  })
}